Non-volatile semiconductor memories such as a flash memory and EEPROM (Electrically Erasable and Programmable Read Only Memory) are known. In such a non-volatile semiconductor memory, a cell transistor having a charge storage layer such as a floating gate is used as a memory cell. When electrons are injected into the charge storage layer, a threshold voltage of the cell transistor is increased. On the other hand, when the electrons are pulled out from the charge storage layer, the threshold voltage of the cell transistor is decreased. By using the change in the threshold voltage, the cell transistor stores the data of “0” or “1”. A state in which the threshold voltage is relatively low is an “erased state”, and this is related to the data of “1”. On the other hand, a state in which the threshold voltage is relatively high is a “written state” (“programmed state”), and this is related to the data of “0”.
In a typical non-volatile semiconductor memory, data write is executed after data erasure is executed once. As an example, the write of the data of “0001” is considered. In this case, after the data of all the corresponding bits are erased and the bit state becomes “1111”, the data of “0001” is again written. At this time, the electron injection (writing process) is performed in each of the three memory cells corresponding to the bits of “0”, and the electron injection is not performed on the other memory cells. As a result, the values of the bits corresponding to the three memory cells are changed from “1” to “0”.
Here, a case is assumed that the respective bits of the data of “0001” are inverted and the inversion data of “1110” is written. In that case, the number of bits of “0” included in the inversion data is “1”. Thus, it is adequate to perform the electron injection into only the memory cell corresponding to the one bit. That is, since the inversion data of “1110” is written instead of the data of “0001”, a power consumption amount (a current consumption amount) required to write the data can be reduced.
As described above, when the write data includes many bits of “0”, the power consumption amount can be reduced by writing its inversion data. Whether the write data is written in its original state or the inverted state is indicated by an “inversion flag”. The inversion flag is related to the write data or inversion data and written with the data in the memory. When the data is read, the original data can be recovered from a read data, by referring to this inversion flag. Such a technique is described in the Japanese Patent Publication (JP 2002-244932A: conventional example 1).
The properties necessary for a device that uses the non-volatile semiconductor memory are different depending on a product in which the device is mounted. A product operated with a battery such as a portable telephone requires an operation in a small power consumption amount. Also, a product whose safety is considered to be most important such as an automobile requires extremely high data reliability. However, the development of a different device for each applied product is not preferable from the viewpoint of a cost.